
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

const login = resolve => require(['@/components/view/login.vue'],resolve);  //登录
const allIndex = resolve => require(['@/components/MainIndex/allIndex.vue'],resolve);
//首页
const homePage = resolve => require(['@/components/page/home.vue'],resolve);  
//消息
const messagePage = resolve => require(['@/components/page/messagePage.vue'],resolve);
//我的
const userPage = resolve => require(['@/components/page/userPage.vue'],resolve);
//列表
const goodsList = resolve => require(['@/components/detail/goodsList.vue'],resolve); 
//商城详情
const shopPageDetail = resolve => require(['@/components/detail/shopPageDetail.vue'],resolve);    
//直播详情
const liveDetail = resolve => require(['@/components/detail/liveDetail.vue'],resolve); 
//打开练声
const clockVocal = resolve => require(['@/components/detail/clockVocal.vue'],resolve);  
//打开主页
const clockIndexPage = resolve => require(['@/components/detail/clockIndexPage.vue'],resolve);   
const  routerMaps=[
    // {name:'login',path:'/login',component:login,meta:{title:'登录'}},
    {name:'allIndex',path:'/allIndex',component:allIndex,children:[
        {name:'homePage',path:'/homePage',component:homePage,meta:{title:'首页'}}, 
        {name:'messagePage',path:'/messagePage',component:messagePage,meta:{title:'消息'}},
        {name:'userPage',path:'/userPage',component:userPage,meta:{title:'我的'}},
    ]},
    {name:'goodsList',path:'/goodsList',component:goodsList,meta:{title:''}}, 
    {name:'shopPageDetail',path:'/shopPageDetail',component:shopPageDetail,meta:{title:'详情'}}, 
    {name:'liveDetail',path:'/liveDetail',component:liveDetail,meta:{title:'详情'}},   
    {name:'clockVocal',path:'/clockVocal',component:clockVocal,meta:{title:'打开练声'}},{name:'clockIndexPage',path:'/clockIndexPage',component:clockIndexPage,meta:{title:'打开主页'}}, 
    {path: '*', redirect: '/homePage'}
];
const router=new Router({
  mode:'hash',
  routes:routerMaps
});
export default router
